const express = require('express');
const router = express.Router();
const foodController = require('../controllers/foodController');
const { protect } = require('../middleware/authMiddleware');

// 搜索食物
router.get('/search', protect, foodController.searchFoods);

// 获取推荐食物
router.get('/recommend', protect, foodController.getRecommendedFood);

// 获取食物分类列表
router.get('/categories', protect, foodController.getFoodCategories);

// 获取单个食物详情
router.get('/:id', protect, foodController.getFoodById);

// 添加自定义食物
router.post('/custom', protect, foodController.addCustomFood);

// 使用天行API搜索食物
router.get('/tianapi/search', protect, foodController.searchTianapiFood);

module.exports = router; 